<template>
    <div class="con">
        医疗管理系统
        <el-avatar src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"></el-avatar><span class="operate">{{username}}</span>
        <el-button type="info" icon="el-icon-switch-button" circle @click="exit" ></el-button>
    </div>
</template>

<script>
    import storage from 'good-storage'
    export default {
        data(){
            return{
                username:storage.get("user").realName
            }
        },
        methods:{
            exit(){
               window.localStorage.removeItem("username")
                storage.remove("user")
                this.$router.push("/login")
            }
        }
    }
</script>

<style scoped>

    .el-avatar--circle {
        border-radius: 50%;
        /* display: inline-block; */
        position: absolute;
        right: 150px;
        top: 15px;
    }
    .el-button{
        position: absolute;
        right: 80px;
        top: 15px;
    }
    .operate{
        color: #fff;
        position: absolute;
        right: 200px;
        font-size: 0.8em;
    }
    .con {

    }

    .tx {
        display: inline-block;
    }
</style>